From 51e92b79d88dbc9c691d069901e5a3c17a9e24cc Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 29 Jan 2021 08:20:36 -0700 Subject: [PATCH] tidy modernize-use-auto --- exif.cc | 16 ++++++++-------- garmin_gpi.cc | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/exif.cc b/exif.cc index 783406fd8..124ff4edb 100644 --- a/exif.cc +++ b/exif.cc @@ -286,12 +286,12 @@ static double exif_read_double(const ExifTag* tag, const int index) { if (tag->type == EXIF_TYPE_RAT) { - uint32_t num = tag->data.at(index * 2).value(); - uint32_t den = tag->data.at((index * 2) + 1).value(); + auto num = tag->data.at(index * 2).value(); + auto den = tag->data.at((index * 2) + 1).value(); return (double)num / (double)den; } else { // EXIF_TYPE_SRAT - int32_t num = tag->data.at(index * 2).value(); - int32_t den = tag->data.at((index * 2) + 1).value(); + auto num = tag->data.at(index * 2).value(); + auto den = tag->data.at((index * 2) + 1).value(); return (double)num / (double)den; } } @@ -1399,8 +1399,8 @@ exif_write_apps() if (tag_size == nullptr) { fatal(MYNAME ": Invalid image file, in IFD1 both JPEGInterchangeFormat and JPEGInterchangeFormatLength must exist for compressed thumbnails."); } - uint32_t offset = tag_offset->data.at(0).value(); - uint32_t size = tag_size->data.at(0).value(); + auto offset = tag_offset->data.at(0).value(); + auto size = tag_size->data.at(0).value(); image_data.append(QPair(offset, size)); exif_put_long(IFD1, IFD1_TAG_JPEG_OFFS, 0, len); len += size; @@ -1411,8 +1411,8 @@ exif_write_apps() fatal(MYNAME ": Invalid image file, in IFD1 both StripOffsets and StripByteCounts must exist and have equal counts for uncompressed thumbnails."); } for (unsigned idx = 0; idx < tag_offset->count; idx++) { - uint32_t offset = tag_offset->data.at(idx).value(); - uint32_t size = tag_size->data.at(idx).value(); + auto offset = tag_offset->data.at(idx).value(); + auto size = tag_size->data.at(idx).value(); image_data.append(QPair(offset, size)); if (tag_offset->type == EXIF_TYPE_SHORT) { exif_put_short(IFD1, IFD1_TAG_STRIP_OFFS, idx, len); diff --git a/garmin_gpi.cc b/garmin_gpi.cc index 842157e27..e9fabb876 100644 --- a/garmin_gpi.cc +++ b/garmin_gpi.cc @@ -429,7 +429,7 @@ read_poi(const int sz, const int tag) (void) len; int pos = gbftell(fin); - Waypoint* wpt = new Waypoint; + auto* wpt = new Waypoint; wpt->icon_descr = DEFAULT_ICON; wpt->latitude = GPS_Math_Semi_To_Deg(gbfgetint32(fin)); -- 2.30.2